Honour user-defined codon frequencies (+FU) for GY-type models - #210
Merged
Conversation
ModelCodon::init replaced a user-defined frequency type with the model's
default for every mechanistic model. The MG family needs that (its
frequencies are nucleotide-targeted and +FU is turned into F3X4), but
initGY94() returns FREQ_EMPIRICAL, so GY{...}+FU{f1,...,f61} became GY+F:
the 61 values were never read, the report said GY+F with 60 free
parameters and every +FU vector gave the same likelihood. 2.4.0 honoured
the request.
Apply the fallback only when codon_freq_style == CF_TARGET_NT. GY-type
models now keep FREQ_USER_DEFINED, read the frequencies and report +FU
with no free frequency parameters; MG behaviour is unchanged.
Test: test_iqtree.sh/.ps1 run GY+FU with frequencies from
test_data/codon_freq.txt and a GY+F3X4 control on a small codon
alignment; expect_ans.txt carries their log-likelihoods. The +FU row
fails by 26.4 on unmodified master.
Fixes iqtree#192
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaHntBDKuZJpMAAMenkC44
bqminh
added a commit
that referenced
this pull request
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ModelCodon::init replaced a user-defined frequency type with the model's default for every mechanistic model. The MG family needs that (its frequencies are nucleotide-targeted and +FU is turned into F3X4), but initGY94() returns FREQ_EMPIRICAL, so GY{...}+FU{f1,...,f61} became GY+F: the 61 values were never read, the report said GY+F with 60 free parameters and every +FU vector gave the same likelihood. 2.4.0 honoured the request.
Apply the fallback only when codon_freq_style == CF_TARGET_NT. GY-type models now keep FREQ_USER_DEFINED, read the frequencies and report +FU with no free frequency parameters; MG behaviour is unchanged.
Test: test_iqtree.sh/.ps1 run GY+FU with frequencies from test_data/codon_freq.txt and a GY+F3X4 control on a small codon alignment; expect_ans.txt carries their log-likelihoods. The +FU row fails by 26.4 on unmodified master.
Fixes #192
Claude-Session: https://claude.ai/code/session_01TaHntBDKuZJpMAAMenkC44